<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<title>行波故障管理</title>
		<!-- <link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" /> -->
		<style type="text/css">
.ui-datatable-scrollable-header-box {
	margin-left: 0px;
	margin-right: 15px !important;
}

.ui-datalist-empty-message {
	min-height: 100px;
}

.ui-datalist-content {
	min-height: 100px;
}

.faultForm:faultTime_input {
	width: 100px;
	!
	important;
}

#addFaultReportForm .ui-calendar>.ui-state-default {
	border: 0px;
}

.ui-button-icon-only .ui-button-text {
	padding: .3em;
	text-indent: -9999999px;
	height: 27px;
}


/**如果datable使用了：resizableColumns ="true"，需要增加以下样式**/
.ui-datatable-resizable {
	overflow: visible !important;
}
</style>
	</ui:define>
	<ui:define name="content">
		<div id="headDiv" class="box box-solid with-border">
			<h:form id="headForm">
				<div class="box-header" id="queryDiv">
					<p:commandButton value="选择设备" id="chooseBtn"
						style="margin-right:5px;display:none"
						actionListener="#{travelingWaveFaultController.getEquipmentByStation()}">
						<p:ajax event="dialogReturn"
							listener="#{travelingWaveFaultController.onFaultDeviceChosen}"
							update="faultDevice" />
					</p:commandButton>
					<div style="float: left; width: 150px">
						<div class="ui-inputgroup">
							<p:inputText placeholder="故障设备" id="faultDevice"
								value="#{travelingWaveFaultController.faultDevice}"
								style="width:110px;" />
							<p:commandButton icon="fa fa-search"
								onclick="document.getElementById('headForm:chooseBtn').click()"
								styleClass="white-button" style="height:28px" />
						</div>
					</div>
					<p:outputLabel for="popup7" value="故障时间：" />
					<p:calendar id="popup7" navigator="true"
						value="#{travelingWaveFaultController.queryDate1}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
						<p:ajax event="dateSelect"
							listener="#{travelingWaveFaultController.onDateSelectStart}" />
					</p:calendar>
					<p:outputLabel for="popup8" value="至 "
						style="margin-right:5px;margin-left:5px;" />
					<p:calendar id="popup8" navigator="true"
						value="#{travelingWaveFaultController.queryDate2}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
						<p:ajax event="dateSelect"
							listener="#{travelingWaveFaultController.onDateSelectEnd}" />
					</p:calendar>
					<p:commandButton value="查询" id="query2"
						oncomplete="getTableScrollHeight()"
						update="form:dataTb" icon="ui-icon-search"
						actionListener="#{travelingWaveFaultController.query}"
						style="margin-left:10px;">
					</p:commandButton>
					<p:commandButton icon="ui-icon-refresh" value="重置"
						actionListener="#{travelingWaveFaultController.resetQuery}"
						style="margin-left:5px;" oncomplete="getTableScrollHeight()"
						update="chooseBtn faultDevice popup7 popup8 form:dataTb" />
				</div>
			</h:form>
		</div>
		<div id="infoDiv" class="box box-solid with-border">
			<h:form id="form">
				<p:growl id="msgs" showDetail="true" />
				<p:dataTable id="dataTb" var="item"
					value="#{travelingWaveFaultController.listsModel}"
					rowKey="#{item.id}" emptyMessage="无记录" rows="20" paginator="true"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} 
								{LastPageLink} {RowsPerPageDropdown}"
					lazy="true" editable="false" editMode="cell" rowIndexVar="ite"
					resizableColumns="true" rowsPerPageTemplate="20,30,50"
					paginatorPosition="bottom" liveResize="false"
					rowSelectMode="single" disabledTextSelection="false"
					scrollable="true">
					<f:facet name="{Customization}">
						<p:outputLabel
							value="总计：#{travelingWaveFaultController.count} 条记录"
							style="margin-right:20px;"></p:outputLabel>
					</f:facet>
					<p:column width="10" headerText="序号 " style="text-align:center">
						<h:outputText value="#{ite+1}" />
					</p:column> 
					<p:column selectRow="false" width="60" headerText="故障时间 "
						style="text-align:center;">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.pickTime}">
							<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
						</h:outputText>
					</p:column>
					<p:column width="30" headerText="测距类型" style="text-align:center">
						<h:outputText rendered="#{null==item.type}" value="" />
						<h:outputText rendered="#{0==item.type}" value="双端测距" />
						<h:outputText rendered="#{1==item.type}" value="单端测距" />
					</p:column>
					<p:column width="80" headerText="线路名称" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.lineName}" />
					</p:column>
					<p:column width="50" headerText="本端设备" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.localDeviceName}" />
					</p:column>
					<p:column width="90" headerText="本端设备厂家及型号描述"
						style="text-align:center">
						<h:outputText value="#{item.localDeviceDesc}" />
					</p:column>
					<p:column width="50" headerText="本端变电站" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.localStationName}" escape="false" />
					</p:column>
					<p:column width="50" headerText="对端设备" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;display:block;"
							value="#{item.peerDeviceName}" escape="false" />
					</p:column>
					<p:column width="90" headerText="对端设备厂家及型号描述" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.peerDeviceDesc}" escape="false" />
					</p:column>
					<p:column width="40" headerText="对端变电站" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.peerStationName}" escape="false" />
					</p:column>
					<p:column width="40" headerText="波速度(km/ms)" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.waveVelocity}" escape="false" />
					</p:column>
					<p:column width="50" headerText="测距故障结果" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.localFaultResultDesc}" escape="false" />
					</p:column>
					<p:column width="50" headerText="设备测距故障结果" style="text-align:center">
						<h:outputText style="white-space:pre-wrap;"
							value="#{item.localDeviceFaultResultDesc}" escape="false" />
					</p:column>
					<!-- <p:column width="50" headerText="行波文件下载" style="text-align:center">
					    <p:commandLink ajax="false" value="下载" style="text-decoration:underline;color:red;"
								    rendered="#{s:hasPermission(session,'jcsj_lbwjck_cz_xz')}"
									actionListener="#{travelingWaveFaultController.prepareDownload(item.id)}">
									<p:fileDownload value="#{travelingWaveFaultController.file}"></p:fileDownload> 
					    </p:commandLink>
					</p:column> -->
				</p:dataTable>
			</h:form>
		</div>

	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/js/tables/singleScrollTable.js" />
		<script
			src="/ui/map/dialog/riskAlarmDialog/searchAlarmMsgDlg.js?version=1.0" />
	</ui:define>
</ui:composition>